import React from "react";
import AntIcon from '@ant-design/icons';

import '../../assets/font/redarefont.css';
import BaseComponent from "../BaseComponent";


export default class Icon extends BaseComponent {

    static defaultProps = {
        name: '',
        size: 18,
        color: '#333'
    };

    _onClick() {
        if (this.props.onClick) {
            this.props.onClick();
        }
    }

    render() {
        return (
            <AntIcon component={() => <i className={`redare-icon ${this.props.name}`} style={({
                fontSize: this.props.size,
                color: this.props.color
            })}/>} onClick={this._onClick.bind(this)}/>
        )
    }
}
